package com.transaction.manage.localMapper;

import com.transaction.manage.model.dto.FundYield;
import com.transaction.manage.myMapper.MyMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;
import java.util.List;

public interface FundYieldMapper extends MyMapper<FundYield> {

    @Update("UPDATE fund_yield SET valid_flag = '00' ,check_flag = '00' WHERE id = #{id} ")
    void deleteFundYield(Integer id);

    @Update("UPDATE fund_yield SET check_flag = '01' WHERE id = #{id} ")
    void checkFundYield(Integer id);

    List<FundYield> selectFundYieldList(FundYield fundYield);

    void insertFundYield(FundYield fundYield);

    void updateFundYield(FundYield fundYield);

    FundYield selectFundYieldByChannelAndFundAndAmount(@Param("channelCode") String channelCode,
                                                       @Param("fundCode") String fundCode,
                                                       @Param("beginAmount") BigDecimal beginAmount,
                                                       @Param("endAmount") BigDecimal endAmount);


    FundYield selectFundYield(@Param("channelCode") String channelCode,
                              @Param("fundCode") String fundCode,
                              @Param("applyAmount") BigDecimal applyAmount);
}